<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Fieldset 作为“子表单”</title>
	</head>
	<body>
		<form id="form" action="#">
			<fieldset name="userFields">
				<legend>info</legend>
				<input name="login" type="text" />
			</fieldset>
		</form>

		<script>
			console.log(form.elements.login) // <input name="login" type="text" />

			let fieldset = form.elements.userFields

			console.log(fieldset.elements.login === form.elements.login) // true
		</script>
	</body>
</html>
